import api from '@/services/goods/inventory-log';

export type InventoryLogList = InventoryLogApi.ListResponse;
export const getFilterList = async () => {
  const res = await api.getFilterList();
  return res.data;
};
export const getList = async (params: InventoryLogApi.ListParams) => {
  const res = await api.getList<InventoryLogList>(params);
  const tableData: Requestor.TableFormatedData<InventoryLogList> = {
    data: res.listData,
    current: res.page + 1,
    pageSize: res.limit,
    total: res.count,
    success: res.success,
  };

  return tableData;
};

export default {
  getFilterList,
  getList,
};
